<template>
	<!-- 轮播图模块 -->
	<view class="content">
		<view class="page-section-spacing">
			<swiper class="swiper" 
				indicator-dots="true" 
				autoplay="true" 
				interval="5000" 
				duration="1500"	>
				<swiper-item v-for="(item , index) in homeSlide" :key="index">
					<image :src="item" mode=""></image>
				</swiper-item>
			</swiper>
		</view>
		
		<!-- 视频模块 -->
		<view class="liu-video" v-for="item in video">
		<h3>{{item.vname}}</h3>
			<video id="myVideo"  class="uni-video"
				:src="item.vurl"
			    @error="videoErrorCallback" :danmu-list="danmuList" @objectFit="cover" enable-danmu danmu-btn
				:poster="item.vimg"></video>	
		</view>
		
		
		
	</view>
</template>

<script>	
	export default {
		data() {
			return {
				homeSlide: ["https://img03.sogoucdn.com/app/a/100520024/c94573dadaf2d22189b4713bf096b7fd",
				"https://img02.sogoucdn.com/app/a/100520024/f96b5e87cf8b885b80f1d5519f2f3036",
				"https://img02.sogoucdn.com/app/a/100520024/c6cda13b22ee1bf8bd45e300a7a8a4bf",
				"https://img04.sogoucdn.com/app/a/100520024/7acbfdcb036c6cbe8d759f9b24b51641"
				],
				
				// 弹幕
				 danmuList: [{
				         text: '柯俊豪666',
				         color: '#ff0000',
				         time: 1
				     },{
				         text: '柯俊豪666',
				         color: 'green',
				         time: 1
				     }
				 ],
				 
				//视频地址
				  video:[]
				 
			}
		},
		onLoad:function(){
			uni.request({  
			            url:"http://k1998.xyz/www/public/index.php/index/video/add",  
			            method: 'POST',  
			            success: res => {  
			               console.log(res.data)
						   this.video = res.data;
			            }  
			        })  
		},
		methods: {
			img(){
				uni.chooseImage({
					count: 3,
					sizeType: "compressed" ,
					success:res=>{
						console.log(res)
						this.msg = res
					}
				})
			},
			local(){
				uni.getLocation({
					success:res=>{
						console.log(res)
						this.msg = res
					}
				})
			}
		},
		onNavigationBarButtonTap() {
		            console.log("你点击了按钮")
		        },
		        onNavigationBarSearchInputChanged () {
		            console.log("你输入了信息")
		        }
	}
</script>

<style>
	.content{
		background-color: white;
	}
	
	
	.swiper{
		height: 400upx;
		background-color: #2C405A;
	}
	
	swiper-item image{
		width: 100%;
		height: 100%;
	}
	//轮播图圆角
	.page-section-spacing{
		border: #2C405A 5px solid;
		border-radius: 8px;
	}
	
	
	//视频内容
	.uni-video{
		width: 90%;
		margin-top: 0px;
		margin-left: 10px;
		margin-right: 20px;
		border: #96c2f1 7px solid;
		border-radius: 20px;
		box-shadow:5px 2px 6px #000 inset;
		
	}
	
	
	//视频
	.liu-video{
		background:#eff7ff;
		text-align:center;
	}
	

</style>
